package cn.ctvonline.android.kaopu.fragment;

import cn.ctvonline.android.kaopu.base.BaseFragment;

/**
 * Created by dujian on 15/11/26.
 */
public abstract class LazyBaseFragment extends BaseFragment {
    private boolean isVisiable;

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if (getUserVisibleHint()) {
            isVisiable = true;
            onVisiable();
        } else {
            isVisiable = false;
            onInvisiable();
        }
    }

    protected void onVisiable() {
//        lazyLoadData();
    }

    protected void onInvisiable() {

    }

    protected abstract void lazyLoadData();
}
